package com.droolsspringboot.service;

import com.droolsspringboot.model.Person;
import org.kie.api.runtime.KieSession;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class TestService {
    @Resource
    private KieSession kieSession;

    public int test() {
        Person person = new Person();
        person.setName("张三");
        kieSession.insert(person);
        int ruleFiredCount = kieSession.fireAllRules();
        return ruleFiredCount;
    }

}
